package edu.shiep.sunyu.model;

import com.mongodb.BasicDBObject;

public class Booking implements BaseDBObj {
	
	public static final String Field_Bus_Id = "bus_id";
	public static final String Field_User_Id = "user_id";
	public static final String Field_Date = "date";
	public static final String Field_Time = "time";
	
	public Booking() {
		
	}
	
	public void deserialize(BasicDBObject obj) {
		_bus_id = obj.getString(Field_Bus_Id);
		_user_id = obj.getString(Field_User_Id);
		_date = obj.getString(Field_Date);
		_time = obj.getString(Field_Time);
	}
	
	public BasicDBObject serialize() {
		return new BasicDBObject(Field_Bus_Id, this._bus_id).
				append(Field_User_Id, this._user_id).
				append(Field_Date, this._date).
				append(Field_Time, this._time);
	}
	
	public void setBusId(String _bus_id) {
		this._bus_id = _bus_id;
	}
	
	public String getBusId() {
		return this._bus_id;
	}	
	
	public void setUserId(String _user_id) {
		this._user_id = _user_id;
	}
	
	public String getUserId() {
		return this._user_id;
	}
	
	public void setDate(String _date) {
		this._date = _date;
	}
	
	public String getDate() {
		return this._date;
	}
	
	public void setTime(String _time) {
		this._time = _time;
	}
	
	public String getTime() {
		return this._time;
	}
	
	private String _bus_id = "";
	private String _user_id = "";
	private String _date = "";
	private String _time = "";
	
}
